local mt = ac.skill['炎阳冲击']
mt.damage = 100
mt.targettype = '物体'
mt.range = 999999
mt.model1 = [[ffe8d87898c77cc6666e3a8662f3d0d5.mdx]]
mt.model2 = [[Abilities\Spells\Other\Doom\DoomDeath.mdl]]

function mt:on_cast_shot()
    local point = self.target:get_point()
    local group = {}
    self:on_shot(point,group)
end

function mt:on_shot(point,group)
    local hero = self.owner
    local time = 0.5
    point:add_effect(self.model1,time)
    ac.wait(time*1000,function()
        point:add_effect(self.model2):remove()
        hero:aoe_damage(point,175,self.damage,self,function(u)
            if group[u.handle] then
                return true
            end
            group[u.handle] = true
        end)
    end)
end


local mt = ac.skill['境界天火']
mt.model1 = [[ffe8d87898c77cc6666e3a8662f3d0d5.mdx]]
mt.model2 = [[Abilities\Spells\Other\Doom\DoomDeath.mdl]]
mt.temp = '攻击触发'

function mt:on_init(hero)
    self:gc(hero:add('智力成长',self.data3))
end
function mt:on_run(hero,target)
    local hero = self.owner
    local time = 0.5
    local damage = hero:get('攻击') * self.data1/100 + hero:get('智力') * self.data2/100
    local point = target:get_point()
    point:add_effect(self.model1,time)
    ac.wait(time*1000,function()
        point:add_effect(self.model2):remove()
        hero:aoe_damage(point,175,damage,self)
    end)
end




local mt = ac.skill['末日陨石']
mt.area = 900
mt.missile_art = [[7da3bd647a3d8dfa6d8dc091d1700467.mdl]]
mt.effect1 = [[6c7bfc99e174320bfd3b693e7b0350b2.mdl]]
mt.effect2 = [[Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl]]

function mt:on_cast_shot()
    local hero = self.owner
    local point1 = hero:get_point()
    local angle = hero:get_facing()
    local group = {}
    local num = 3
    for a=1,num do
        local r = angle + (a-num/2 - 0.5)*30
        local point2 = point1 - {r,300}
        self:shot_missile(point2,r,group)
    end
end


function mt:shot_missile(point2,angle,group)
    local hero = self.owner
    local damage = hero:get('攻击') * self.data1/100
    point2:effect
    {
        model = self.effect1,
        angle = angle,
        size = 1,
        speed = 0.58,
        time = 1.75,
    }
    ac.wait(1.3*1000,function()
        local mover = ac.mover('line'){
            start = point2,
            angle = angle,
            model = self.missile_art,
            height = 50,
            speed = 320,
            size = 1,
            distance = 1200,
        }
        sc.loopUnit(0.03,mover,120,function(_,unit)
            if unit:is_enemy(hero) then
                hero:create_damage(unit,damage,self)
            end
        end):set_lock(group)
    end)
end